package com.ruoyi.plus.api;

import com.ruoyi.common.config.RuoYiConfig;
import com.ruoyi.common.core.api.ApiResult;
import com.ruoyi.common.utils.StringUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author likun
 */
@Slf4j
@Api(tags = "sysApi-系统Api")
@RestController
@RequestMapping("api/system/sysApi")
public class SysApi {

    @ApiOperation("getApiName-获取ApiName")
    @GetMapping("/getApiName")
    @ResponseBody
    public ApiResult<String> getApiName() {
        String apiName = RuoYiConfig.getApiName();
        if (StringUtils.isEmpty(apiName)) {
            return new ApiResult<String>().setData("");
        }
        return new ApiResult<String>().setData(apiName);
    }
}
